home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-17 | 7.9 KB | 221 lines | [TEXT/MPS ] |
- #
- # ****************************************************************************
- #
- # File Name: PageMaker.vu
- #
- # Contains: Quick look test script for Pagemaker version 4.2
- #
- # Written by: Kevin Avoy, Ken Landreth, Michael Leong, Gil Spencer et al
- #
- # Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
- #
- # ****************************************************************************
- # C h a n g e H i s t o r y (most recent first):
- # ****************************************************************************
- #
- # Vers Date Author Description
- # ---- -------- ------ ---------------------------------------------
- # <1.0.6> 9/30/93 KTA Initialize gFileName prior to gApptitle being updated by
- # launchTwitch().
- # <1.0.5> 9/28/93 KTA Added returnVal for ModifyDocument hook.
- # <1.0.2> 6/16/93 NAGA Renaming InitGlobals(ScriptLevel)to InitGlobals(ScriptLevel)
- # <1+> 5/25/93 NAGA Adding header and porting old files to follow new standards
- #
- # ****************************************************************************
- #
-
-
-
- ########################################################################
- # External libraries
- #=======================================================================
- Libraries "Output.Lib", "DoTasks.Lib","Draw.Lib","UserInterface.Lib","DA.Lib", "Font.Lib", "Globals.Lib", "LaunchQuit.Lib", "TCS.Lib";
-
-
- #########################################################################
- ######## Application Specific Tasks
- #########################################################################
-
- #########################################################################
- # InitAppGlobals()
- #========================================================================
- # Author: KA
- # Description: Sets up tools and fonts for Pagemaker. This task
- # must be called first.
- # Parameters: None
- # Returns: Nothing
- # Examples: InitAppGlobals()
- #========================================================================
- # History:
- #
- ########################################################################
- task InitAppGlobals()
- begin
-
- logstr("setting up {global gApptitle}'s globals");
- global kClick, kDrag, kDragClick, kMultiDrag, kMultiClickDrag, kMultiClick;
- global kPalDocWind, kPalWind, kPullOffPal, kPopUpPal, kScrollPal;
- global kToolPaletteNum := 1;
- global kLinePaletteNum := 0;
- global kPatternPaletteNum := 0;
- global kColorPaletteNum := 0;
-
- global gLineWeights := {};# This is used for menuItems
-
- global gWindowInset := {20,40,20,20}; # Window inset
- global gScreenInset := {0,20,0,0}; # Screen inset
- global gVoidRect := {}; # Rect not to draw in - coordinates should be RelativeToWindow
- global gTextStr;
- global gDocumentWindow := 0; # only used in Freehand at this point;
-
- global gPaletteList := {
- { #### Start Palette #1 - Tools
- {'Toolbox',18}, # List := {Specifier for Palette window ("String" if TITLE, integer if ORD), Header height}.
- kPalWind, # Palette type
- {4,2}, # Size of Tool matrix {numElemsWide,numElemsTall}
- {30,20} # Offset between tools {h,v}
- } #### End Palette #1
- };
-
-
- ### PageMaker {Flag, Pattern, Line, Color}
- ### Palette Elements:= Tool#, Pal#, ToolName, ToolType, DblClktoEnd SetAttributes
- global PointerTool := { 1, 1, "Pointer", kClick, 0, {0}};
- global LineTool := { 2, 1, "Line", kDrag, 0, {0}};
- global StraightLine := { 3, 1, "StraightLine", kDrag, 0, {0}};
- global CharTool := { 4, 1, "Character", kClick, 0, {gTextStr}};
-
- global RectTool := { 5, 1, "Rect", kDrag, 1, {0}};
- global RndRectTool := { 6, 1, "RndRect", kDrag, 0, {0}};
- global OvalTool := { 7, 1, "Oval", kDrag, 0, {0}};
- global CropTool := { 8, 1, "Crop", kDrag, 0, {0}};
-
-
-
- # global Tool list
- global gToolList:={ PointerTool,
- LineTool,
- StraightLine,
- CharTool,
-
- RectTool,
- RndRectTool,
- OvalTool,
- CropTool
- };
-
- ### font characteristic lists
- global gFontSizeList := {'6','8','9','10','11','12','14','18', '24','30','36','48','60','72'};
- #global gFontSizeList := {'6','8','9','10','11','12','14','18', '24'};
- global gFontStyleList := {"Bold","Italic","Underline","Strikethru","Outline","Shadow"};
-
- ### Name of the Plain (style) menu item ####
- global gPlainStyle := "Normal"; # Plain-Style menu item
-
- ### How to get to the next line
- global gNextLineMethod := 1;
- ### 1 - ReturnKey, 2 - EnterKey, 3 - DownArrow Key, 4 - TabKey, {} - Move/Click, {'Untitled'} - Move relative to the window titled 'Untitled' /Click
-
- ### Does moving to the next line clear all font info
- global gNextLineClearsFontSettings := 0;
-
- end; #InitAppGlobals
-
- #########################################################################
- # PageMakerModifyDocument()
- #========================================================================
- # Author: ML
- # Description: Modify Canvas Document
- # Parameters: None
- # Returns: Nothing
- # Examples: PageMakerModifyDocument();
- # Assumptions: None
- # Applications: PageMaker
- #========================================================================
- # History:
- #
- #########################################################################
- task PageMakerModifyDocument()
- begin
- return(Scrapbook(global kScrapTEXT));
- end;
-
- #########################################################################
- # DoDrawPageMaker()
- #========================================================================
- # Author: KTA
- # Description: Test draw in Pagemaker.
- # Parameters: None
- # Returns: Nada
- # Examples: DoDrawPageMaker();
- # Assumptions: PageMaker
- #========================================================================
- # History:
- #
- #########################################################################
- task DoDrawPageMaker()
- begin
- #Set up a Void Rect so that we don't draw on the ToolBox
- ToolWindow := FindWindow('ToolBox');
- TheRect := ToolWindow.r;
- global gVoidRect := TheRect;
- DoDraw();
- end;
-
- #########################################################################
- # DoTextPageMaker()
- #========================================================================
- # Author: KTA
- # Description: Test text in Pagemaker.
- # Parameters: None
- # Returns: Nada
- # Examples: DoTextPageMaker();
- # Assumptions: PageMaker
- #========================================================================
- # History:
- #
- #########################################################################
- task DoTextPageMaker()
- begin
- Global gWindowInset;
- SetTool(global CharTool);
- MoveRelativeToWindow(175,65,,2);
- wait(3);
- DoText();
- SpecialKey(EnterKey, "EnterKey");
- end;
-
- ################################################################################
- #################### Main script ####################
- ################################################################################
- script PageMaker (ScriptLevel:= -1)
- begin
- InitGlobals(ScriptLevel); # initialize your general globals
- InitDraw();
- InitFonts();
- Global gApptitle := "PageMaker";
- global gAppVersion := '4'; # version of app you will be running
- global gFileName := "@!@-{gBuildVers}-{gAppTitle}"; # This is used in SaveAs when saving files
- SuiteStart('PageMaker.vu'); # begin a new test suite
- if LaunchTwitch("{gAppTitle}",gAliasDirectory) # launch or twitch to your app
- begin
- global gModifyDocument:= task PageMakerModifyDocument; # define app specific task
- InitAppGlobals(); # init app specific globals
- (*
- *)
- DoSetUpApp(,-1,,"OK",1,1,1); # No Default window
- DoDrawPageMaker();
- DoTextPageMaker();
- DoWindow();
- DoCloseApp(1);
- end; # if LaunchTwitch("{gAppTitle}",gAliasDirectory)
- SuiteEnd();
- end; # script PageMaker
-
- ### What's Needed
- # 1) Insure that Palette is up and in the left corner or the screen
- # 2) Insure that Pointer tool is selected after DoText before DoWindow
- # 4) Possibly close the toolbox before starting Window tests.
- # 5) Typing below the document window creates an error dialog
-
-